powered by
Aithison's simple zero replacement strategy.
zeroreplace(x, a = 2/3)
A matrix with the compositional data.
The replacement value will be "a" times the minimum value observed in the compositional data.
A matrix with the zero replaced compositional data.
This is the simple zero replacement strategy suggested in Aitchison (1986, pg. 269).
Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.
perturbation, alfa
# NOT RUN { x <- as.matrix(iris[1:20, 1:4]) x <- x/ rowSums(x) x[ sample(1:20, 4), sample(1:4, 1) ] <- 0 zeroreplace(x) # }
Run the code above in your browser using DataLab